﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox.Infrastructure
{
    /// <summary>
    /// 响应集合类型结果的载体
    /// </summary>
    /// <typeparam name="TResult">结果类型</typeparam>
    [JsonObject]
    public class ResultObject<TResult>
    {
        int _rowCount;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="rowCount"></param>
        public ResultObject(int rowCount)
        {
            _rowCount = rowCount;
        }
        /// <summary>
        /// 行数
        /// </summary>
        [JsonProperty("rowCount")]
        public int RowCount
        {
            get { return _rowCount; }
        }
        /// <summary>
        /// 结果数据（IEnumerable 或 DataTable）
        /// </summary>
        [JsonProperty("result")]
        public virtual TResult Result
        {
            get;
            set;
        }
    }
}
